package com.he.principles.DIP.after;

import lombok.Builder;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/8/22 11:40
 */
@Builder
@Data
@Component
public class ComputerAfter {

//    实际开发使用
//    @Autowired
//    @Qualifier("xiJieHardDiskImpl")
//    private HardDiskService hardDiskService;
//
//    @Autowired
//    private CpuService cpuService;
//
//    @Autowired
//    private MemoryService memoryService;


    private HardDiskService hardDiskService;
    private CpuService cpuService;
    private MemoryService memoryService;

    public void run(){
        System.out.println("运行计算机");
        String data = hardDiskService.getHardDisk();
        System.out.println("从硬盘读取到的数据："+data);
        cpuService.run();
        memoryService.save();
    }

}
